home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: TRootObj.c
- ** Written by: Eric Soldan
- **
- ** Copyright © 1992 Apple Computer, Inc.
- ** All rights reserved.
- */
-
- /* You may incorporate this sample code into your applications without
- ** restriction, though the sample code has been provided "AS IS" and the
- ** responsibility for its operation is 100% yours. However, what you are
- ** not permitted to do is to redistribute the source as "DSC Sample Code"
- ** after having made changes. If you're going to re-distribute the source,
- ** we require that you make it clear in the source that the code was
- ** descended from Apple Sample Code, but that you've made changes. */
-
- /* See the files "=How to write your app" and "=Using TreeObj.c" for information
- ** on this function. */
-
- /* This file isn't really used for much here. The whole hierarchical document usage of
- ** AppWannabe is very limited. This file is here so that AppWannabe can be converted
- ** into an application that does use the hierarchical document architecture. AppWannabe
- ** is all set up to start using it. This is convenient, as it allows there to be an
- ** initial document type. */
-
-
-
- /*****************************************************************************/
-
-
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.protos.h" /* Get the prototypes for application. */
-
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- #ifndef __STRING__
- #include <String.h>
- #endif
-
- #ifndef __UTILITIES__
- #include "Utilities.h"
- #endif
-
-
-
- #pragma segment DrawObjects
- long TRootObj(TreeObjHndl hndl, short message, long data)
- {
- short fileRefNum;
- #if VH_VERSION
- char *cptr;
- #endif
-
- switch (message) {
- case FREADMESSAGE:
- fileRefNum = data;
- return(ReadTreeObjData(hndl, fileRefNum));
- break;
-
- case FWRITEMESSAGE:
- fileRefNum = data;
- return(WriteTreeObjData(hndl, fileRefNum));
- break;
-
- case HREADMESSAGE:
- return(HReadTreeObjData(hndl, (Handle)data));
- break;
-
- case HWRITEMESSAGE:
- return(HWriteTreeObjData(hndl, (Handle)data));
- break;
-
- case VHMESSAGE:
- #if VH_VERSION
- cptr = ((VHFormatDataPtr)data)->data;
- ccatchr(cptr, 13, 2);
- VHRootInfo(hndl, cptr);
- ccatchr(cptr, 13, 2);
- VHFileRecInfo(hndl, cptr);
- return(true);
- #endif
- break;
-
- default:
- break;
- }
-
- return(noErr);
- }
-
-
-
-